package com.ruirenyun.util.sms;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Description 阿里云配置
 * @Author hp
 * @Date 2020/9/14 17:25
 * @Version 1.0
 */
@ConditionalOnProperty(prefix = "hysms", name = {"apiId", "apiKey"})
@Component
public class HySmsConfig {

    @Value("${hysms.apiId}")
    private String apiId;

    @Value("${hysms.apiKey}")
    private String apiKey;

    @PostConstruct
    public void init() {
        HySmsUtil.setHySmsConfig(this);
    }

    public String getApiId() {
        return apiId;
    }

    public void setApiId(String apiId) {
        this.apiId = apiId;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }
}
